﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ContactUs.aspx.cs" Inherits="HTComics.Web.Home.ContactUs" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../Css/jquery-ui-1.8.18.custom.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery-ui-1.8.18.custom.min.js" type="text/javascript"></script>

    <script type="text/javascript">
        $(document).ready(doOnLoad);

        function doOnLoad() {
            $("#MainContent_btnSubmit").button();
        }

        function valid() {
            if ($("#MainContent_txtName").val() == "") {
                alert("Please enter your name");
                $("#MainContent_txtName").focus();
                return false;
            }

            if (!validate($("#MainContent_txtEmail").val())) {
                alert("Invalid Email Address");
                $("#MainContent_txtEmail").focus();
                return false;
            }
            if ($("#MainContent_txtQuery").val() == "") {
                alert("Please enter a query");
                $("#MainContent_txtQuery").focus();
                return false;
            }

            return true;
        }

        function validate(address) {

            var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
            if (reg.test(address) == false) {
                return false;
            }

            return true;
        }

        function clearFields() {
            $("#MainContent_txtName").val("");
            $("#MainContent_txtPhone").val("");
            $("#MainContent_txtEmail").val("");
            $("#MainContent_txtQuery").val("");
        }

        function success() {
            $("#divOK").dialog({
                title: "Success",
                modal: true,
                height: 'auto',
                width: 'auto',
                position: ['center', 'middle']
            });
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Heading" runat="server">
Contact Us
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div class="section">
        <span class="header">
            Contact Us
        </span>

        <div class="content">
            <table wdith="100%">
                <tr>
                    <td class="labelBold" width="40%">Name</td>
                    <td><input type="text" runat="server" class="textfield" style="width:200px;" id="txtName"/></td>
                </tr>

                <tr>
                    <td class="labelBold">Phone</td>
                    <td><input type="text" runat="server" class="textfield" style="width:200px;" id="txtPhone"/></td>
                </tr>

                <tr>
                    <td class="labelBold">Email</td>
                    <td><input type="text" runat="server" class="textfield" style="width:200px;" id="txtEmail"/></td>
                </tr>

                <tr>
                    <td class="labelBold">Type</td>
                    <td>
                        <select runat="server" class="dropdown" style="width:208px;" id="selType">
                            <option>Feedback</option>
                            <option>Question</option>
                            <option>Other</option>
                        </select>
                    </td>
                </tr>

                <tr>
                    <td class="labelBold">Query</td>
                    <td><textarea runat="server" id="txtQuery" class="textfield" rows="20" style="height:150px;width:200px;"></textarea></td>
                </tr>

                <tr>
                    <td colspan="2" align="center">
                                        <asp:Button ID="btnSubmit" runat="server" Text="Submit" 
                        onclick="btnSubmit_Click" OnClientClick="return valid();" />                    
                    </td>
                </tr>

            </table>
        </div>
    </div>

            <div id="divOK" style="display:none;">
                Thanks for your valuable input. Your query has been submitted.
            </div>
</asp:Content>
